//
//  cartModel.swift
//  OnceNectar
//
//  Created by Zhang Dream on 2018/6/25.
//  Copyright © 2018年 com.inwhoop. All rights reserved.
//

import Foundation
import MappingAce
import SwiftyJSON

struct cartModel:Mapping {
    
    var goodsId :String?
    var goodsName :String?
    var id :String?
    var number :String?
    var price :String?
    var sessionId :String?
    var specAndCol :String?
    var totalPrice :String?
    var userId :String?
    var imageUrl :String?
    var selected :String?
}

struct payModel:Mapping {
    
    var carriage :String?
    var actualPayAmount :String?
    var payAmount :String?
    
    
    var rows: [cartModel]?
}

extension payModel{
    mutating func initCarts(arr: [JSON]) {
        var xlabers :[cartModel] = []
        for object in arr {
            
            let xmodel = cartModel(fromDic: object.dictionary! )
            
            xlabers.append(xmodel)
        }
        rows = xlabers
    }
}


